package zxq.rollcall.course.controller.action;

import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import zxq.rollcall.course.entity.dto.ResultDTO;
import zxq.rollcall.course.entity.dto.set.CollegeDTO;
import zxq.rollcall.course.entity.dto.set.SchoolDTO;
import zxq.rollcall.course.entity.query.CollegeQuery;
import zxq.rollcall.course.entity.query.PageQuery;
import zxq.rollcall.course.entity.query.SchoolQuery;

import java.util.List;

@Transactional
public interface ISchoolController {

    /**
     * 存储班级信息
     * @param schoolQuery 学校信息
     * @return
     */
    @PostMapping(value = "/save",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "存储学校信息",notes = "存储学校信息")
    @ResponseBody
    ResultDTO<Boolean> save(SchoolQuery schoolQuery);

    /**
     * 修改部门信息
     * @param id 部门id
     * @param schoolQuery 学校信息
     * @return
     */
    @PostMapping(value = "/update",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "修改学校信息",notes = "修改学校信息")
    @ResponseBody
    ResultDTO<Boolean> update(Integer id,SchoolQuery schoolQuery);

    /**
     * 删除学校信息
     * @param id 学校id
     * @return
     */
    @PostMapping(value = "/delete",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "删除学校信息",notes = "删除学校信息")
    @ResponseBody
    ResultDTO<Boolean> delete(Integer id);

    /**
     * 查询学校信息
     * @param pageQuery 页码信息
     * @return
     */
    @GetMapping(value = "/query",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "查询学校信息",notes = "查询学校信息")
    @ResponseBody
    ResultDTO<List<SchoolDTO>> query(PageQuery pageQuery);


}
